import { APlugin } from '../types/common.interface';
import { TableDatas } from '../cors/table-datas';
import {  Inject, Injectable, PluginInjectable } from '../decorators/inject';
import { Select } from '../cors/select';
import { ExecuteRecord } from '../cors/execute-record';
import { Hook } from '../cors/hook';
import { RenderTrigger } from '../cors/render-trigger';
import { TBorderPosition, BorderCommand } from '../commands/border-command';
import { NBorder } from '../types/style.interface';

@Injectable()
@PluginInjectable('BorderPlugin')
export class BorderPlugin extends APlugin {
    constructor(
        protected datas: TableDatas,
        protected executeRecord: ExecuteRecord,
        protected renderTrigger: RenderTrigger,
        protected select: Select,
    ) {
        super();
    }
    public init() {

    }
    public setBorder(position: TBorderPosition, border: NBorder.IBorderStyle) {
        let command = new BorderCommand(this.datas, this.select.selected, this.renderTrigger, border, position);
        this.executeRecord.execute(command);
    }
    public destroy() {

    }
}